package com.wyl.pmd.rule.performance;

public class AddEmptyString {

	public static void main(String[] args) {
		
		String str1 = "123";
		
		String str2 = "" + 123;//bad
		
		String str3 = Integer.toString(123);//good
		
		String str4 = new String("123");
		
		int num1 = 123;
		String str5 = "" + num1;
		
		int num2 = 456;
		String str6 = num2 + "";
		

		Integer num3 = null;
		String str7 = num3 + "";
		
		System.out.println(str1==str2);
		System.out.println(str3==str4);
		System.out.println(str1==str3);
		System.out.println(str1==str4);
		
		System.out.println(str1==str5);
		
		System.out.println(str7);
		
		//执行javap -c AddEmptyString.class 进行反编译 
	}
	
}
